

package cn.shengchao.base.enums;

import cn.shengchao.base.constant.UiConstants;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import top.continew.starter.core.enums.BaseEnum;

/**
 * 启用/禁用状态枚举
 *
 * @author Charles7c
 * @since 2022/12/29 22:38
 */
@Getter
@RequiredArgsConstructor
public enum DisEnableStatusEnum implements BaseEnum<Integer> {

    /**
     * 启用
     */
    ENABLE(1, "启用", UiConstants.COLOR_SUCCESS),

    /**
     * 禁用
     */
    DISABLE(2, "禁用", UiConstants.COLOR_ERROR),
    /**
     * 审批
     */
    APPROVAL(3, "审批", UiConstants.COLOR_WARNING);
    ;

    private final Integer value;
    private final String description;
    private final String color;

    public static DisEnableStatusEnum getByValue(Integer value) {
        for (DisEnableStatusEnum statusEnum : values()) {
            if (statusEnum.getValue().equals(value)) {
                return statusEnum;
            }
        }
        return null;
    }
}
